<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="/WEB-INF/jsp/com/include/declare.jspf" %>
<%@ include file="/WEB-INF/jsp/com/include/doctype.jspf" %>
<script type="text/javascript" src="/kr/common/js/pie/pie_ready.js"></script>
<script type="text/javascript" src="<c:url value='/common/js/jquery-1.7.1.js'/>"></script>
<script type="text/javascript" src="<c:url value='/common/js/jquery-ui-1.8.16.custom.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/common/js/jquery-popup.0.2.js'/>"></script>
<script type="text/javascript" src="<c:url value='/common/js/ajaxupload.js'/>"></script>
<script type="text/javascript" src="<c:url value='/common/js/Common.js'/>"></script>
<script type="text/javascript" src="/kr/common/js/pie/pie_ready.js"></script>
<script>
function evntPrint(id) {
    //$('#'+id).printArea({mode: 'popup', popupClose: false});

    window.print();
}

function returnList(){
    var frm = document.MyPageTdaDetailForm;
    frm.action="<c:url value='/mpg/tdaListPaging.do'/>";
    
    frm.submit();
}

function tdaCancel(){
    var tsrdPrctNo = document.getElementById("tsrdPrctNo");
    
    
    if(tsrdPrctNo.value == "") return;
    
    $.post("<c:url value='/mpg/mpgTdaCancel.do'/>",
            {
                'tsrdPrctNo' : tsrdPrctNo.value
            },
            function(data){
                var result={};
                var items = $(data).find("item");
                items.each(function(index,element){
                   var name = $(this).find("name").text();
                   var value = $(this).find("value").text();
                   result[name] = value;
                });
                if(result["result"] =="OK"){
                   var frm = document.MyPageTdaDetailForm;
                   frm.action="<c:url value='/mpg/tdaListPaging.do'/>";
                   
                   frm.submit();  
                }
                else{
                    alert("예약취소가 실패하였습니다.재시도 하여주십시요");
                    
                    //selEmlTail.focus();
                    return false;                      
                }
                    
            }  
        );   
}

</script>
</head>
<body>
<%@ include file="/WEB-INF/jsp/com/include/layerpopup.jspf" %>
<div id="wrap" class="non-subnavigation">
    <%@ include file="/WEB-INF/jsp/com/include/navi_utill_sub.jspf" %>
    <%@ include file="/WEB-INF/jsp/com/include/navi_header.jspf" %>
    <hr />

    <%@ include file="/WEB-INF/jsp/com/include/sub_header_global03.jspf" %>
    <hr />

	<div id="container">
		<div id="subtitle-area"><div class="subtitle-area-inner">
			<%@ include file="/WEB-INF/jsp/com/include/location.jspf" %>
		</div></div>
        <form name="MyPageTdaDetailForm" id="MyPageTdaListForm" onsubmit="return false">
         <input type="hidden" name="tsrdPrctNo" id="tsrdPrctNo" value = "${mpgSearchInfoVO.tsrdPrctNo}">
		<div id="article">
			<ul class="mypage-navigation">
                <li><a href="<c:url value="/mpg/summeryList.do"/>"><img src="/kr/images/global_menu/navi_mypage01_out.gif" alt="나의 요약정보" /></a></li>
                <li><a href="<c:url value="/mpg/pwdCheckView.do"/>"><img src="/kr/images/global_menu/navi_mypage02_out.gif" alt="회원 정보" /></a></li>
                <li><a href="<c:url value="/mpg/QuotList.do"/>"><img src="/kr/images/global_menu/navi_mypage03_out.gif" alt="최근 견적" /></a></li>
                <li><a href="<c:url value="/mpg/ctlgListPaging.do"/>"><img src="/kr/images/global_menu/navi_mypage04_out.gif" alt="카탈로그 신청 이력" /></a></li>
                <li><a href="<c:url value="/mpg/tdaListPaging.do"/>"><img src="/kr/images/global_menu/navi_mypage05_over.gif" alt="시승 신청 이력" /></a></li>
                <li><a href="<c:url value="/mpg/mpgEvntInfoView.do"/>"><img src="/kr/images/global_menu/navi_mypage06_out.gif" alt="이벤트 참여 이력" /></a></li>
                <li><a href="<c:url value="/mpg/QAListPaging.do"/>"><img src="/kr/images/global_menu/navi_mypage07_out.gif" alt="Q&amp;A" /></a></li>
			</ul>
			<h4 class="subsection"><img src="/kr/images/title/h4_global_menu03_05.gif" alt="시승 신청 이력" /></h4>
			<div class="modify-contents-wrap" id="printArea">
				<h5><img src="/kr/images/title/h5_global_menu03_05_02.gif" alt="시승 신청 내역" /></h5>
				<p class="default-desc"><img src="/kr/images/counsel/txt_counsel_testdrive_inquiry01.gif" alt="카마스터가 확인 전화 후 예약을 확정하여 편리한 시승서비스를 제공하겠습니다. 센터 사정에	따라 차량의 색상이 변경될 수 있습니다." /></p>
				<div class="reservation-stats">
					<div class="cell">
						<img src="/kr/images/common/icon/icon_car.png" alt="자동차 관련 이미지" class="icon-img" />
						<div class="information">
							<p class="car-name">${result.carn }</p>
							<p class="car-info">시승 신청하신 차량은<br /><em>${result.carDtlInfo }/${result.xrclCtyNm}</em> 입니다.</p>
							<img src="/kr/file/imagePathView.do?nrFilNm=trcarimage/${result.cprImgNm}" width="300" height="180"alt="차량이미지" class="car-thumb" />
						</div>
					</div>
					<div class="cell">
						<img src="/kr/images/common/icon/icon_item.png" alt="항목 관련 이미지" class="icon-img" />
						<div class="information">
							<img src="/kr/images/counsel/txt_counsel_testdrive_inquiry02.gif" alt="차량에 대하여 더 자세한 내용이 궁금하시면 아래 항목을 클릭하여 확인하세요" />
							<ul class="item-list">
								<li><a href="/kr/showroom.do?carCd1=${result.carCd }"><img src="/kr/images/counsel/txt_counsel_testdrive_inquiry03.gif" alt="차량 상세정보" /></a></li>
								<li><a href="/kr/estimation/estimationgeneral.do?carcode=${result.carCd }"><img src="/kr/images/counsel/txt_counsel_testdrive_inquiry04.gif" alt="견적내기" /></a></li>
								<li><a href="/kr/qa/qa/selectQaPaging.do"><img src="/kr/images/counsel/txt_counsel_testdrive_inquiry05.gif" alt="Q&amp;A" /></a></li>
							</ul>
						</div>
					</div>
				</div>
				<div class="reservation-information subsection">
					<h5><img src="/kr/images/title/h5_counsel_testdrive_inquiry01.gif" alt="시승 신청 내용" /></h5>
					<div class="boardlist-wrap02">
						<table summary="시승신청 내역">
						<caption>시승신청 내역 목록</caption>
						<colgroup>
							<col width="25%" />
							<col />
						</colgroup>
						<thead>
						<tr>
							<th scope="col">항목</th>
							<th scope="col">내역</th>
						</tr>
						</thead>
						<tbody>
						<tr>
							<td class="bg01">예약 구분</td>
							<td class="last">${result.tsrdSvcNm}</td>
						</tr>
						<tr>
							<td class="bg01">예약 상태</td>
							<td class="last">
								<b class="resevervation_wait">${result.prctStNm}</b>
								<!-- 상태별 정리
								<b class="resevervation_complete">예약확정</b>
								<b class="resevervation_cancel">예약취소</b>
								-->
							</td>
						</tr>
						<tr>
							<td class="bg01">시승자 이름</td>
							<td class="last">${result.sbcrName }</td>
						</tr>
						<tr>
							<td class="bg01">휴대폰 번호</td>
							<td class="last">${result.sbcrPhone }</td>
						</tr>
						<tr>
							<td class="bg01">시승센터</td>
							<td class="last">${result.ctrNm }(전화 : ${result.ctrTel })</td>
						</tr>
						<tr>
							<td class="bg01">시승차량</td>
							<td class="last">${result.carDtlInfo }/${result.xrclCtyNm }</td>
						</tr>
						<tr>
							<td class="bg01">시승일시</td>
							<td class="last">${result.prctDt }</td>
						</tr>
						<tr>
							<td class="bg01">지정카마스터</td>
                            <c:if test="${result.cmCd == null }">
							<td class="last">미정</td>
                            </c:if>
                            <c:if test="${result.cmCd != null }">
                            <td class="last">${result.cmNm }</td>
                            </c:if>
                        </tr>
						<tr>
							<td class="bg01">시승요청위치</td>
							<td class="last">
								<div class="address-wrap">
									<p>${result.ctrAdr }</p>
								</div>
							</td>
						</tr>
						</tbody>
						</table>
					</div>
					<div class="reservation-tip">
						<em class="point01">* 예약 당일 취소하면 추후 시승서비스 참여에 제약이 있으실 수 있습니다.</em>
					</div>
				</div>
				<div class="btnwrap">
					<a href="javascript:returnList()"><img src="/kr/images/common/button/btn_list.gif" alt="목록" /></a>
					<a href="javascript:evntPrint('printArea')"><img src="/kr/images/common/button/btn_print.gif" alt="인쇄" /></a>
					<c:if test="${result.prctSt != 'C' }">
                    <a href="javascript:tdaCancel()"><img src="/kr/images/common/button/btn_reservation_cancel.gif" alt="예약취소" /></a>
				    </c:if>
                </div>
			</div>
		</div>
        </form>
	</div>
	<hr />
    <%@ include file="/WEB-INF/jsp/com/include/footer.jspf" %>